﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using System.Text;
using Vit.Web.Extensions;
using Vit.Web.Models;

namespace Vit.Mvc.Modules
{
    public class ChildActionModule : IWebModule
    {
        public string Area { get { return Parameters.Element("area").Value; } }
        public string Controller { get { return Parameters.Element("controller").Value; } }
        
        #region IWebModule Members

        public Guid ModuleID
        {
            get { return new Guid("2DC72927-AC13-4B86-8315-BF577543D3E2"); }
        }

        public string Icon64X64
        {
            get { return string.Format("/Areas/{0}/Themes/Default/Images/{1}64X64.jpg", Area, Controller); }
        }

        public string Icon32X32
        {
            get { return string.Format("/Areas/{0}/Themes/Default/Images/{1}32X32.jpg", Area, Controller); }
        }

        public string Icon16X16
        {
            get { return string.Format("/Areas/{0}/Themes/Default/Images/{1}16X16.jpg", Area, Controller); }
        }

        public string ViewUrl
        {
            get
            {
                return string.Format("/{0}/{1}/Index", Area, Controller);
            }
        }

        public string EditUrl
        {
            get
            {
                return string.Format("/{0}/{1}/Edit/{{0}}", Area, Controller);
            }
        }

        public string SettingUrl
        {
            get
            {
                return string.Format("/{0}/{1}/Setting/{{0}}", Area, Controller);
            }
        }

        public string DesignUrl
        {
            get
            {
                return string.Format("/{0}/{1}/Design/{{0}}", Area, Controller);
            }
        }

        public string ImportUrl
        {
            get
            {
                return string.Format("/{0}/{1}/Import/{{0}}", Area, Controller);
            }
        }

        public string ExportUrl
        {
            get
            {
                return string.Format("/{0}/{1}/Export/{{0}}", Area, Controller);
            }
        }

        public string HelpUrl
        {
            get
            {
                return string.Format("/{0}/{1}/Help/{{0}}", Area, Controller);
            }
        }

        public IEnumerable<INavigationItem> MenuItems
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        public XElement Parameters { get; set; }

        #endregion

        #region IVersion Members

        public string Name
        {
            get
            {
                return "ChildActionModule.Name".Locale();
            }
        }

        public string Description
        {
            get
            {
                return "ChildActionModule.Description".Locale();
            }
        }

        public Version CurrentVersion
        {
            get
            {
                return new Version("1.0.0.0");
            }
        }

        public DateTime RealeaseDate
        {
            get
            {
                return new DateTime(2010, 10, 1);
            }
        }

        public string CopyRight
        {
            get
            {
                return "ChildActionModule.CopyRight".Locale();
            }
        }

        #endregion
    }
}
